﻿#ifndef DIALOG_SETRUNNINGMODE_H
#define DIALOG_SETRUNNINGMODE_H

#include <qdialog.h>
#include "ObjAutoInject.h"
#include <qradiobutton.h>

namespace Ui {
  class Dialog_SetRunningMode;
}

class DeviceInfoManager;
class LineEdit_TurnTablePosition;
class LineEdit_TurnTableRate;
class LineEdit_TurnTableAcceleration;
class Dialog_SetRunningMode : public QDialog,public ObjAutoInject
{
  Q_OBJECT
private://ui
  Ui::Dialog_SetRunningMode *ui;
  QRadioButton* radioButton_positionMode=Q_NULLPTR;
  QRadioButton* radioButton_rateMode=Q_NULLPTR;
  LineEdit_TurnTablePosition* lineEdit_position=Q_NULLPTR;
  LineEdit_TurnTableRate* lineEdit_rate=Q_NULLPTR;
  LineEdit_TurnTableAcceleration* lineEdit_acceleration=Q_NULLPTR;
private://property
  uint deviceId=0;
private://dependency
  DeviceInfoManager* deviceInfoManager=Q_NULLPTR;
public:
  explicit Dialog_SetRunningMode(QWidget *parent = nullptr);
  virtual ~Dialog_SetRunningMode();
public:
  virtual int exec()override;
  bool getRunningMode();
  float getPosition();
  float getRate();
  float getAcceleration();
public slots:
  virtual void accept()override;
  virtual void reject()override;
private slots:
  void slot_updateDeviceInfo();
  void slot_updatePositionMode();
  void slot_updateRateMode();
public://geter and seter
  uint getDeviceId();
  Dialog_SetRunningMode* setDeviceId(uint deviceId);
  DeviceInfoManager* getDeviceInfoManager()const;
  Dialog_SetRunningMode* setDeviceInfoManager(DeviceInfoManager* const deviceInfoManager);
public:
  virtual void objectAutoInjection(QHash<QString,QObject*>* objMap)override;
};

#endif // DIALOG_SETRUNNINGMODE_H
